package bookshop.service.impl;

import bookshop.dao.DaoFactory;
import bookshop.dao.OrderTraceDao;
import bookshop.domain.OrderTrace;
import bookshop.service.OrderTraceService;
import bookshop.service.helper.OrderTraceQueryHelper;
import bookshop.utils.Page;

public class OrderTraceServiceImpl implements OrderTraceService {

	public void SaveOrderTrace(OrderTrace orderTrace) {
		OrderTraceDao orderTraceDao = (OrderTraceDao) DaoFactory
				.getDao("orderTraceDao");
		orderTraceDao.AddOrderTrace(orderTrace);
	}

	public Page GetOrderTraceByConnection(
			OrderTraceQueryHelper helper, Page page) {
		OrderTraceDao orderTraceDao = (OrderTraceDao) DaoFactory
				.getDao("orderTraceDao");
		page.setPageContent(orderTraceDao.GetOrderTraceByConnection(helper,
				page.getStartIndex(), page.getPageSize()));
		page.setTotalRecNum(orderTraceDao.countOrderTraceByConditon(helper));
		
		return page;

	}
}
